# model

# determine the current user and delete (close) all (the chosen) credentials from 'OctopusCloudDatabase' (internal storage)

from google.appengine.ext import webapp

from Utilities import *

class DeleteCredentials(webapp.RequestHandler):
    def get(self):
        utilities = Utilities()
        
        # get some basic attributes
        username = utilities.getUsername()
        regionname = self.request.get('regionname')
        endpointURL = self.request.get('endpointURL')
        accessKey = self.request.get('accessKey')
        
        # check for existing credentials and delete them
        utilities.deleteCredentialEntry(username, regionname, endpointURL, accessKey)
        
        self.redirect('/regions') 